﻿Imports MICROFORMA.BEL
Imports MICROFORMA.DAL

Public Class SolicitudBL


    Private _Solicitud_DA As SolicitudDA = Nothing

    Public Function Add(ByVal SolicitudBE As SolicitudBE) As String
        If _Solicitud_DA.Add(SolicitudBE) = "OK" Then
            If SolicitudBE.Estado = "0" Then
                SolicitudBE.EstadoDescripcion = "Activo"
                Return "OK"
            End If
        End If
    End Function

    Public Function getIdLastRecord() As Int16
        Return _Solicitud_DA.getIdLastRecord
    End Function

    Public Function Edit(ByVal SolicitudBE As SolicitudBE) As String
        If _Solicitud_DA.Edit(SolicitudBE) = "OK" Then
            Return "OK"
        End If
    End Function

    Public Function Delete(ByVal Id As Integer) As String
        If _Solicitud_DA.Delete(Id) = "OK" Then
            Return "OK"
        End If
    End Function

    Public Function List() As DataTable
        Return _Solicitud_DA.List()
    End Function

    Public Function List_Id(ByVal Id As Integer) As DataTable
        Return _Solicitud_DA.List_Id(Id)
    End Function

    Public Function GetList() As DataTable
        Return _Solicitud_DA.GetList
    End Function

    Public Sub New()
        _Solicitud_DA = New SolicitudDA
    End Sub


End Class
